package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PcPurchaseReq generated by hbm2java
 */
@Entity
@Table(name="pc_purchase_req"
    ,catalog="ncsc_erp"
)
public class PcPurchaseReq  implements java.io.Serializable {


     private long prNo;
     private PcPurchaseReqStatus pcPurchaseReqStatus;
     private SysTermOfPayment sysTermOfPayment;
     private MmSupplierType mmSupplierType;
     private MmSupplier mmSupplier;
     private HrEmp hrEmp;
     private SysTitleName sysTitleName;
     private String prCode;
     private String prDescr;
     private Date prDate;
     private String prSupplierCode;
     private String prSupplierFirstName;
     private String prSupplierMidName;
     private String prSupplierLastName;
     private String prSupplierIdCardNo;
     private String prTermOfPaymentCode;
     private BigDecimal prDiscountPerc;
     private BigDecimal prDiscountVal;
     private BigDecimal prDiscountTotal;
     private short prStatusIncVat;
     private BigDecimal prVatPercVal;
     private BigDecimal prTotalPriceExcVat;
     private BigDecimal prTotalVat;
     private BigDecimal prTotalPrice;
     private Date prCreatedDtm;
     private String prMemo;
     private Set<PcPurchaseOrder> pcPurchaseOrders = new HashSet<PcPurchaseOrder>(0);
     private Set<PcPurchaseReqItem> pcPurchaseReqItems = new HashSet<PcPurchaseReqItem>(0);

    public PcPurchaseReq() {
    }

	
    public PcPurchaseReq(long prNo, String prCode, String prDescr, Date prDate, BigDecimal prDiscountPerc, BigDecimal prDiscountVal, BigDecimal prDiscountTotal, short prStatusIncVat, BigDecimal prVatPercVal, BigDecimal prTotalPriceExcVat, BigDecimal prTotalVat, BigDecimal prTotalPrice) {
        this.prNo = prNo;
        this.prCode = prCode;
        this.prDescr = prDescr;
        this.prDate = prDate;
        this.prDiscountPerc = prDiscountPerc;
        this.prDiscountVal = prDiscountVal;
        this.prDiscountTotal = prDiscountTotal;
        this.prStatusIncVat = prStatusIncVat;
        this.prVatPercVal = prVatPercVal;
        this.prTotalPriceExcVat = prTotalPriceExcVat;
        this.prTotalVat = prTotalVat;
        this.prTotalPrice = prTotalPrice;
    }
    public PcPurchaseReq(long prNo, PcPurchaseReqStatus pcPurchaseReqStatus, SysTermOfPayment sysTermOfPayment, MmSupplierType mmSupplierType, MmSupplier mmSupplier, HrEmp hrEmp, SysTitleName sysTitleName, String prCode, String prDescr, Date prDate, String prSupplierCode, String prSupplierFirstName, String prSupplierMidName, String prSupplierLastName, String prSupplierIdCardNo, String prTermOfPaymentCode, BigDecimal prDiscountPerc, BigDecimal prDiscountVal, BigDecimal prDiscountTotal, short prStatusIncVat, BigDecimal prVatPercVal, BigDecimal prTotalPriceExcVat, BigDecimal prTotalVat, BigDecimal prTotalPrice, Date prCreatedDtm, String prMemo, Set<PcPurchaseOrder> pcPurchaseOrders, Set<PcPurchaseReqItem> pcPurchaseReqItems) {
       this.prNo = prNo;
       this.pcPurchaseReqStatus = pcPurchaseReqStatus;
       this.sysTermOfPayment = sysTermOfPayment;
       this.mmSupplierType = mmSupplierType;
       this.mmSupplier = mmSupplier;
       this.hrEmp = hrEmp;
       this.sysTitleName = sysTitleName;
       this.prCode = prCode;
       this.prDescr = prDescr;
       this.prDate = prDate;
       this.prSupplierCode = prSupplierCode;
       this.prSupplierFirstName = prSupplierFirstName;
       this.prSupplierMidName = prSupplierMidName;
       this.prSupplierLastName = prSupplierLastName;
       this.prSupplierIdCardNo = prSupplierIdCardNo;
       this.prTermOfPaymentCode = prTermOfPaymentCode;
       this.prDiscountPerc = prDiscountPerc;
       this.prDiscountVal = prDiscountVal;
       this.prDiscountTotal = prDiscountTotal;
       this.prStatusIncVat = prStatusIncVat;
       this.prVatPercVal = prVatPercVal;
       this.prTotalPriceExcVat = prTotalPriceExcVat;
       this.prTotalVat = prTotalVat;
       this.prTotalPrice = prTotalPrice;
       this.prCreatedDtm = prCreatedDtm;
       this.prMemo = prMemo;
       this.pcPurchaseOrders = pcPurchaseOrders;
       this.pcPurchaseReqItems = pcPurchaseReqItems;
    }
   
     @Id 

    
    @Column(name="PR_NO", unique=true, nullable=false)
    public long getPrNo() {
        return this.prNo;
    }
    
    public void setPrNo(long prNo) {
        this.prNo = prNo;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_STATUS_NO")
    public PcPurchaseReqStatus getPcPurchaseReqStatus() {
        return this.pcPurchaseReqStatus;
    }
    
    public void setPcPurchaseReqStatus(PcPurchaseReqStatus pcPurchaseReqStatus) {
        this.pcPurchaseReqStatus = pcPurchaseReqStatus;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_TERM_OF_PAYMENT_NO")
    public SysTermOfPayment getSysTermOfPayment() {
        return this.sysTermOfPayment;
    }
    
    public void setSysTermOfPayment(SysTermOfPayment sysTermOfPayment) {
        this.sysTermOfPayment = sysTermOfPayment;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_SUPPLIER_TYPE_NO")
    public MmSupplierType getMmSupplierType() {
        return this.mmSupplierType;
    }
    
    public void setMmSupplierType(MmSupplierType mmSupplierType) {
        this.mmSupplierType = mmSupplierType;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_SUPPLIER_NO")
    public MmSupplier getMmSupplier() {
        return this.mmSupplier;
    }
    
    public void setMmSupplier(MmSupplier mmSupplier) {
        this.mmSupplier = mmSupplier;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_CREATED_BY_EMP_NO")
    public HrEmp getHrEmp() {
        return this.hrEmp;
    }
    
    public void setHrEmp(HrEmp hrEmp) {
        this.hrEmp = hrEmp;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PR_SUPPLIER_TITLE_NO")
    public SysTitleName getSysTitleName() {
        return this.sysTitleName;
    }
    
    public void setSysTitleName(SysTitleName sysTitleName) {
        this.sysTitleName = sysTitleName;
    }

    
    @Column(name="PR_CODE", nullable=false, length=50)
    public String getPrCode() {
        return this.prCode;
    }
    
    public void setPrCode(String prCode) {
        this.prCode = prCode;
    }

    
    @Column(name="PR_DESCR", nullable=false, length=100)
    public String getPrDescr() {
        return this.prDescr;
    }
    
    public void setPrDescr(String prDescr) {
        this.prDescr = prDescr;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="PR_DATE", nullable=false, length=10)
    public Date getPrDate() {
        return this.prDate;
    }
    
    public void setPrDate(Date prDate) {
        this.prDate = prDate;
    }

    
    @Column(name="PR_SUPPLIER_CODE", length=50)
    public String getPrSupplierCode() {
        return this.prSupplierCode;
    }
    
    public void setPrSupplierCode(String prSupplierCode) {
        this.prSupplierCode = prSupplierCode;
    }

    
    @Column(name="PR_SUPPLIER_FIRST_NAME", length=50)
    public String getPrSupplierFirstName() {
        return this.prSupplierFirstName;
    }
    
    public void setPrSupplierFirstName(String prSupplierFirstName) {
        this.prSupplierFirstName = prSupplierFirstName;
    }

    
    @Column(name="PR_SUPPLIER_MID_NAME", length=50)
    public String getPrSupplierMidName() {
        return this.prSupplierMidName;
    }
    
    public void setPrSupplierMidName(String prSupplierMidName) {
        this.prSupplierMidName = prSupplierMidName;
    }

    
    @Column(name="PR_SUPPLIER_LAST_NAME", length=50)
    public String getPrSupplierLastName() {
        return this.prSupplierLastName;
    }
    
    public void setPrSupplierLastName(String prSupplierLastName) {
        this.prSupplierLastName = prSupplierLastName;
    }

    
    @Column(name="PR_SUPPLIER_ID_CARD_NO", length=20)
    public String getPrSupplierIdCardNo() {
        return this.prSupplierIdCardNo;
    }
    
    public void setPrSupplierIdCardNo(String prSupplierIdCardNo) {
        this.prSupplierIdCardNo = prSupplierIdCardNo;
    }

    
    @Column(name="PR_TERM_OF_PAYMENT_CODE", length=50)
    public String getPrTermOfPaymentCode() {
        return this.prTermOfPaymentCode;
    }
    
    public void setPrTermOfPaymentCode(String prTermOfPaymentCode) {
        this.prTermOfPaymentCode = prTermOfPaymentCode;
    }

    
    @Column(name="PR_DISCOUNT_PERC", nullable=false, precision=10)
    public BigDecimal getPrDiscountPerc() {
        return this.prDiscountPerc;
    }
    
    public void setPrDiscountPerc(BigDecimal prDiscountPerc) {
        this.prDiscountPerc = prDiscountPerc;
    }

    
    @Column(name="PR_DISCOUNT_VAL", nullable=false, precision=15)
    public BigDecimal getPrDiscountVal() {
        return this.prDiscountVal;
    }
    
    public void setPrDiscountVal(BigDecimal prDiscountVal) {
        this.prDiscountVal = prDiscountVal;
    }

    
    @Column(name="PR_DISCOUNT_TOTAL", nullable=false, precision=15)
    public BigDecimal getPrDiscountTotal() {
        return this.prDiscountTotal;
    }
    
    public void setPrDiscountTotal(BigDecimal prDiscountTotal) {
        this.prDiscountTotal = prDiscountTotal;
    }

    
    @Column(name="PR_STATUS_INC_VAT", nullable=false)
    public short getPrStatusIncVat() {
        return this.prStatusIncVat;
    }
    
    public void setPrStatusIncVat(short prStatusIncVat) {
        this.prStatusIncVat = prStatusIncVat;
    }

    
    @Column(name="PR_VAT_PERC_VAL", nullable=false, precision=10)
    public BigDecimal getPrVatPercVal() {
        return this.prVatPercVal;
    }
    
    public void setPrVatPercVal(BigDecimal prVatPercVal) {
        this.prVatPercVal = prVatPercVal;
    }

    
    @Column(name="PR_TOTAL_PRICE_EXC_VAT", nullable=false, precision=15)
    public BigDecimal getPrTotalPriceExcVat() {
        return this.prTotalPriceExcVat;
    }
    
    public void setPrTotalPriceExcVat(BigDecimal prTotalPriceExcVat) {
        this.prTotalPriceExcVat = prTotalPriceExcVat;
    }

    
    @Column(name="PR_TOTAL_VAT", nullable=false, precision=15)
    public BigDecimal getPrTotalVat() {
        return this.prTotalVat;
    }
    
    public void setPrTotalVat(BigDecimal prTotalVat) {
        this.prTotalVat = prTotalVat;
    }

    
    @Column(name="PR_TOTAL_PRICE", nullable=false, precision=15)
    public BigDecimal getPrTotalPrice() {
        return this.prTotalPrice;
    }
    
    public void setPrTotalPrice(BigDecimal prTotalPrice) {
        this.prTotalPrice = prTotalPrice;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="PR_CREATED_DTM", length=19)
    public Date getPrCreatedDtm() {
        return this.prCreatedDtm;
    }
    
    public void setPrCreatedDtm(Date prCreatedDtm) {
        this.prCreatedDtm = prCreatedDtm;
    }

    
    @Column(name="PR_MEMO", length=500)
    public String getPrMemo() {
        return this.prMemo;
    }
    
    public void setPrMemo(String prMemo) {
        this.prMemo = prMemo;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseReq")
    public Set<PcPurchaseOrder> getPcPurchaseOrders() {
        return this.pcPurchaseOrders;
    }
    
    public void setPcPurchaseOrders(Set<PcPurchaseOrder> pcPurchaseOrders) {
        this.pcPurchaseOrders = pcPurchaseOrders;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseReq")
    public Set<PcPurchaseReqItem> getPcPurchaseReqItems() {
        return this.pcPurchaseReqItems;
    }
    
    public void setPcPurchaseReqItems(Set<PcPurchaseReqItem> pcPurchaseReqItems) {
        this.pcPurchaseReqItems = pcPurchaseReqItems;
    }




}


